﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Remoting.Activation;

namespace StockMatch.Service.AOPBasics
{
    [AttributeUsage(AttributeTargets.Class)]
    public abstract class AOPAttribute : Attribute, IContextAttribute
    {
        public AOPAttribute() { }
        public abstract AOPProperty CreateContextProperty();

        public void GetPropertiesForNewContext(IConstructionCallMessage msg)
        {
            AOPProperty contextProperty = CreateContextProperty();
            msg.ContextProperties.Add(contextProperty);
        }

        public bool IsContextOK(Context ctx, IConstructionCallMessage msg)
        {
            return false;
        }
    }
}
